package time_task

import (
	. "chess_platform/internal/common"
	"chess_platform/models/pc"
	"time"
)

//每隔两分钟上报一次服务器数据
func ReportPlatform() error {
	load := Load
	Load = 0
	data := map[string]interface{}{
		"report_time": time.Now().Unix(),
		"load":        load,
	}
	return pc.UpdatePlatform(data, PlatformConf.Id)
}

//每隔一天清理服务器重启次数
func ClearReportPlatform() error {
	data := map[string]interface{}{
		"restart_count": 0,
	}
	return pc.UpdatePlatform(data, PlatformConf.Id)
}
